import Login from '../page/Login'
import Article from '../page/Article'

import {createBrowserRouter} from "react-router-dom";
import Layout from "../page/Layout";
import Board from "../page/Board";
import About from "../page/About";
import NotFound from "../page/NotFound";

 const router= createBrowserRouter([

     {
       path:'/',
       element:<Layout/>,
       children:[
           {
               // 摄制为默认二级路由，一级路由访问的时候，它也能得到渲染
               index:true,
               element:<Board/>
           },
           {
               path:'/about',
               element:<About/>
           },


       ]
     },

     {
         path:'/login/:id/:name',
         element: <Login/>
     },
     {
         path:'/article',
         element: <Article/>
     },
     {
         path:'*',
         element:<NotFound/>
     },

    
])

export default router;